﻿using System;

class SignedShortAsBinary
{
    static void Main(string[] args)
    {
        int decimalNumber = 56;
        string result;

        if (decimalNumber < 0)
        {
            string positiveNumber = BinaryGenerator(-1 * decimalNumber - 1);
            char[] array = positiveNumber.ToCharArray();

            for (int i = 0; i < positiveNumber.Length; i++)
            {
                if (array[i] == '1')
                {
                    array[i] = '0';
                }
                else
                {
                    array[i] = '1';
                }
            }
            result = new string(array);
            Console.WriteLine(result);
        }
        else
        {
            result = BinaryGenerator(decimalNumber);
            Console.WriteLine(result);
        }
    }
  
    private static string BinaryGenerator(int decimalNumber)
    {
        string result = "";
        while (decimalNumber != 0)
        {
            result += (decimalNumber % 2).ToString();
            decimalNumber /= 2;
        }
        char[] reversedArray = result.ToCharArray();
        Array.Reverse(reversedArray);
        result = new string(reversedArray);
        return result.PadLeft(16, '0');
    }
}